﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using ChartDirector;

namespace CSharpChartExplorer
{
    public class FrmZoomScrollDemo2 : System.Windows.Forms.Form
    {
        // XY data points for the chart
        private double[] dataX0;
        private double[] dataY0;
        private double[] dataX1;
        private double[] dataY1;
        private double[] dataX2;
        private double[] dataY2;

        // The full x-axis and y-axis scales at no zooming. 
        private double minX = 0;
        private double maxX = 0;
        private double minY = 0;
        private double maxY = 0;

        // Internal variables to keep track of the currently pressed navigation button.
        private Button activeNavigateButton = null;

        // Internal variables to keep track of mouse positions during dragging of navigateWindow. 
        private int mouseDownXCoor;
        private int mouseDownYCoor;

        //
        // Controls in the form
        // *** Automatically generated by Windows Form Designer ***
        //
        private System.Windows.Forms.Label topLabel;
        private System.Windows.Forms.Panel leftPanel;
        private System.Windows.Forms.RadioButton pointerPB;
        private System.Windows.Forms.RadioButton zoomInPB;
        private System.Windows.Forms.RadioButton zoomOutPB;
        private System.Windows.Forms.Label zoomLevelLabel;
        private System.Windows.Forms.TrackBar zoomBar;
        private System.Windows.Forms.Button upLeftPB;
        private System.Windows.Forms.Button upPB;
        private System.Windows.Forms.Button upRightPB;
        private System.Windows.Forms.Button leftPB;
        private System.Windows.Forms.Button centerPB;
        private System.Windows.Forms.Button rightPB;
        private System.Windows.Forms.Button downLeftPB;
        private System.Windows.Forms.Button downPB;
        private System.Windows.Forms.Button downRightPB;
        private System.Windows.Forms.Panel navigatePad;
        private System.Windows.Forms.Label navigateWindow;
        private System.Windows.Forms.Label separator;
        private ChartDirector.WinChartViewer winChartViewer1;
        private System.Windows.Forms.Timer buttonRepeatTimer;
        private System.Windows.Forms.ToolTip toolTip;
        private System.ComponentModel.IContainer components;

        public FrmZoomScrollDemo2()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
        }

        /// <summary>
        /// Clean up any resources used.
        /// *** Automatically generated by Windows Form Designer ***
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        /// <summary>
        /// Form Load event handler - initialize the form
        /// </summary>
        private void FrmZoomScrollDemo2_Load(object sender, System.EventArgs e)
        {
            //
            // For simplicity, in this demo, we just use hard coded data. In a real application,
            // the data probably read from a dynamic source such as a database. (See the
            // ChartDirector documentation on "Using Data Sources with ChartDirector" if you need
            // some sample code on how to read data from database to array variables.)
            //
            dataX0 = new double[] {10, 15, 6, -12, 14, -8, 13, -3, 16, 12, 10.5, -7, 3, -10, -5, 2,
				5};
            dataY0 = new double[] {130, 150, 80, 110, -110, -105, -130, -15, -170, 125,  125, 60, 
				25, 150, 150, 15, 120};
            dataX1 = new double[] { 6, 7, -4, 3.5, 7, 8, -9, -10, -12, 11, 8, -3, -2, 8, 4, -15, 15 };
            dataY1 = new double[] {65, -40, -40, 45, -70, -80, 80, 10, -100, 105, 60, 50, 20, 170, 
				-25, 50, 75};
            dataX2 = new double[] {-10, -12, 11, 8, 6, 12, -4, 3.5, 7, 8, -9, 3, -13, 16, -7.5, -10,
				-15};
            dataY2 = new double[] {65, -80, -40, 45, -70, -80, 80, 90, -100, 105, 60, -75, -150, 
				-40, 120, -50, -30};

            // Initially choose the pointer mode (draw to scroll mode)
            pointerPB.Checked = true;

            // Can update chart now
            winChartViewer1.updateViewPort(true, true);
        }

        /// <summary>
        /// CheckChanged event for the pointerPB.
        /// </summary>
        private void pointerPB_CheckedChanged(object sender, System.EventArgs e)
        {
            pointerPB.BackColor = pointerPB.Checked ? Color.PaleGreen : pointerPB.Parent.BackColor;
            if (pointerPB.Checked)
                winChartViewer1.MouseUsage = WinChartMouseUsage.ScrollOnDrag;
        }

        /// <summary>
        /// CheckChanged event for the zoomInPB.
        /// </summary>
        private void zoomInPB_CheckedChanged(object sender, System.EventArgs e)
        {
            zoomInPB.BackColor = zoomInPB.Checked ? Color.PaleGreen : zoomInPB.Parent.BackColor;
            if (zoomInPB.Checked)
                winChartViewer1.MouseUsage = WinChartMouseUsage.ZoomIn;
        }

        /// <summary>
        /// CheckChanged event for the zoomOutPB.
        /// </summary>
        private void zoomOutPB_CheckedChanged(object sender, System.EventArgs e)
        {
            zoomOutPB.BackColor = zoomOutPB.Checked ? Color.PaleGreen : zoomOutPB.Parent.BackColor;
            if (zoomOutPB.Checked)
                winChartViewer1.MouseUsage = WinChartMouseUsage.ZoomOut;
        }

        /// <summary>
        /// MouseDown event handler for the navigator buttons.
        /// </summary>
        private void navigateButton_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            activeNavigateButton = (Button)sender;
            buttonRepeatTimer.Start();
        }

        /// <summary>
        /// MouseUp event handler for the navigator buttons.
        /// </summary>
        private void navigateButton_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            activeNavigateButton = null;
            buttonRepeatTimer.Stop();
        }

        /// <summary>
        /// Tick event handler for the buttonRepeatTimer. This is the clock used to constantly 
        /// scroll the chart when a navigator button is pressed 
        /// </summary>
        private void buttonRepeatTimer_Tick(object sender, System.EventArgs e)
        {
            if (activeNavigateButton != null)
            {
                double vpLeft = winChartViewer1.ViewPortLeft;
                double vpTop = winChartViewer1.ViewPortTop;

                // Each tick scroll the chart by 5% in the button direction
                if ((activeNavigateButton == leftPB) || (activeNavigateButton == upLeftPB)
                    || (activeNavigateButton == downLeftPB))
                    vpLeft -= winChartViewer1.ViewPortWidth * 0.05;
                if ((activeNavigateButton == rightPB) || (activeNavigateButton == upRightPB)
                    || (activeNavigateButton == downRightPB))
                    vpLeft += winChartViewer1.ViewPortWidth * 0.05;
                if ((activeNavigateButton == upPB) || (activeNavigateButton == upLeftPB)
                    || (activeNavigateButton == upRightPB))
                    vpTop -= winChartViewer1.ViewPortHeight * 0.05;
                if ((activeNavigateButton == downPB) || (activeNavigateButton == downLeftPB)
                    || (activeNavigateButton == downRightPB))
                    vpTop += winChartViewer1.ViewPortHeight * 0.05;

                // Update the chart, but no need to update the image map yet, as the chart is still 
                // Scrolling and is unstable
                scrollChartTo(winChartViewer1, vpLeft, vpTop);
            }
        }

        /// <summary>
        /// MouseDown event handler for the center button.
        /// </summary>
        private void centerPB_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            // Center the view port at the origin (0, 0) 
            scrollChartTo(winChartViewer1, 0.5 - winChartViewer1.ViewPortWidth / 2,
                0.5 - winChartViewer1.ViewPortHeight / 2);
        }

        /// <summary>
        /// ValueChanged event handler for zoomBar. Zoom in around the center point and try to 
        /// maintain the aspect ratio
        /// </summary>
        private void zoomBar_ValueChanged(object sender, System.EventArgs e)
        {
            //Remember the center point
            double centerX = winChartViewer1.ViewPortLeft + winChartViewer1.ViewPortWidth / 2;
            double centerY = winChartViewer1.ViewPortTop + winChartViewer1.ViewPortHeight / 2;

            //Aspect ratio and zoom factor
            double aspectRatio = winChartViewer1.ViewPortWidth / winChartViewer1.ViewPortHeight;
            double zoomTo = ((double)zoomBar.Value) / zoomBar.Maximum;

            //Zoom while respecting the aspect ratio
            winChartViewer1.ViewPortWidth = zoomTo * Math.Max(1, aspectRatio);
            winChartViewer1.ViewPortHeight = zoomTo * Math.Max(1, 1 / aspectRatio);

            //Adjust ViewPortLeft and ViewPortTop to keep center point unchanged
            winChartViewer1.ViewPortLeft = centerX - winChartViewer1.ViewPortWidth / 2;
            winChartViewer1.ViewPortTop = centerY - winChartViewer1.ViewPortHeight / 2;

            //update the chart, but no need to update the image map yet, as the chart is still 
            //zooming and is unstable
            winChartViewer1.updateViewPort(true, false);
        }

        /// <summary>
        /// MouseDown event handler for the navigateWindow
        /// </summary>
        private void navigateWindow_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                // Save the mouse coordinates to keep track of how far the navigateWindow has been 
                // dragged.
                mouseDownXCoor = e.X;
                mouseDownYCoor = e.Y;
            }
        }

        /// <summary>
        /// MouseMove event handler for the navigateWindow
        /// </summary>
        private void navigateWindow_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                // Is currently dragging - move the navigateWindow based on the distances dragged
                int newLabelLeft = Math.Max(0, navigateWindow.Left + e.X - mouseDownXCoor);
                int newLabelTop = Math.Max(0, navigateWindow.Top + e.Y - mouseDownYCoor);

                // Ensure the navigateWindow is within the navigatePad container
                if (newLabelLeft + navigateWindow.Width > navigatePad.ClientSize.Width)
                    newLabelLeft = navigatePad.ClientSize.Width - navigateWindow.Width;
                if (newLabelTop + navigateWindow.Height > navigatePad.ClientSize.Height)
                    newLabelTop = navigatePad.ClientSize.Height - navigateWindow.Height;

                // Update the navigateWindow position as it is being dragged
                navigateWindow.Left = newLabelLeft;
                navigateWindow.Top = newLabelTop;

                // Update the WinChartViewer ViewPort as well
                winChartViewer1.ViewPortLeft = ((double)navigateWindow.Left) /
                    navigatePad.ClientSize.Width;
                winChartViewer1.ViewPortTop = ((double)navigateWindow.Top) /
                    navigatePad.ClientSize.Height;

                // Update the chart, but no need to update the image map yet, as the chart is still 
                // scrolling and is unstable
                winChartViewer1.updateViewPort(true, false);
            }
        }

        /// <summary>
        /// Scroll the view port to the given position if necessary
        /// </summary>
        private void scrollChartTo(WinChartViewer viewer, double vpLeft, double vpTop)
        {
            // Validate the parameters
            vpLeft = Math.Max(0, Math.Min(vpLeft, 1 - viewer.ViewPortWidth));
            vpTop = Math.Max(0, Math.Min(vpTop, 1 - viewer.ViewPortHeight));

            if ((vpLeft != viewer.ViewPortLeft) || (vpTop != viewer.ViewPortTop))
            {
                // Update chart only if the view port has changed
                viewer.ViewPortLeft = vpLeft;
                viewer.ViewPortTop = vpTop;
                viewer.updateViewPort(true, false);
            }
        }

        /// <summary>
        /// The MouseEntered handler for the ChartViewer. In this demo, we delay creating the image 
        /// map until the mouse actually enters the chart. This avoids creating unnecessary image
        /// maps while the chart is still scrolling.
        /// </summary>
        private void winChartViewer1_MouseEnter(object sender, System.EventArgs e)
        {
            updateImageMap(winChartViewer1);
        }

        /// <summary>
        /// ClickHotSpot event handler. In this demo, we just list out the hot spot information in 
        /// a pop up dialog.
        /// </summary>
        private void winChartViewer1_ClickHotSpot(object sender, WinHotSpotEventArgs e)
        {
            // We show the pop up dialog only when the mouse action is not in zoom-in or zoom-out mode.
            if ((winChartViewer1.MouseUsage != WinChartMouseUsage.ZoomIn)
                && (winChartViewer1.MouseUsage != WinChartMouseUsage.ZoomOut))
                new ParamViewer().Display(sender, e);
        }

        /// <summary>
        /// The ViewPortChanged event handler. This event occurs when the user changes the 
        /// WinChartViewer view port by dragging scrolling, or by zoom in/out, or the 
        /// WinChartViewer.updateViewPort method is being called.
        /// </summary>
        private void winChartViewer1_ViewPortChanged(object sender, WinViewPortEventArgs e)
        {
            if (!navigateWindow.Capture)
            {
                // We need to update the navigator window size and position only if the view port 
                // changes are not caused by the navigateWindow itself.
                navigateWindow.Left = (int)Math.Round(winChartViewer1.ViewPortLeft *
                    navigatePad.ClientSize.Width);
                navigateWindow.Top = (int)Math.Round(winChartViewer1.ViewPortTop *
                    navigatePad.ClientSize.Height);
                navigateWindow.Width = (int)Math.Max(1.0, winChartViewer1.ViewPortWidth *
                    navigatePad.ClientSize.Width);
                navigateWindow.Height = (int)Math.Max(1.0, winChartViewer1.ViewPortHeight *
                    navigatePad.ClientSize.Height);
            }

            // Synchronize the zoom bar value with the view port width/height
            zoomBar.Value = (int)Math.Round(Math.Min(winChartViewer1.ViewPortWidth,
                winChartViewer1.ViewPortHeight) * zoomBar.Maximum);

            // Update chart and image map if necessary
            if (e.NeedUpdateChart)
                drawChart(winChartViewer1);
            if (e.NeedUpdateImageMap)
                updateImageMap(winChartViewer1);
        }

        /// <summary>
        /// Draw the chart.
        /// </summary>
        private void drawChart(WinChartViewer viewer)
        {
            // Create an XYChart object 500 x 480 pixels in size, with the same background color
            // as the container
            XYChart c = new XYChart(500, 480, Chart.CColor(BackColor));

            // Set the plotarea at (50, 40) and of size 400 x 400 pixels. Use light grey (c0c0c0)
            // horizontal and vertical grid lines. Set 4 quadrant coloring, where the colors of 
            // the quadrants alternate between lighter and deeper grey (dddddd/eeeeee). 
            c.setPlotArea(50, 40, 400, 400, -1, -1, -1, 0xc0c0c0, 0xc0c0c0
                ).set4QBgColor(0xdddddd, 0xeeeeee, 0xdddddd, 0xeeeeee, 0x000000);

            // Enable clipping mode to clip the part of the data that is outside the plot area.
            c.setClipping();

            // Set 4 quadrant mode, with both x and y axes symetrical around the origin
            c.setAxisAtOrigin(Chart.XYAxisAtOrigin, Chart.XAxisSymmetric + Chart.YAxisSymmetric);

            // Add a legend box at (450, 40) (top right corner of the chart) with vertical layout
            // and 8 pts Arial Bold font. Set the background color to semi-transparent grey.
            LegendBox legendBox = c.addLegend(450, 40, true, "arialbd.ttf", 8);
            legendBox.setAlignment(Chart.TopRight);
            legendBox.setBackground(0x40dddddd);

            // Add a titles to axes
            c.xAxis().setTitle("Alpha Index");
            c.yAxis().setTitle("Beta Index");

            // Set axes width to 2 pixels
            c.xAxis().setWidth(2);
            c.yAxis().setWidth(2);

            // The default ChartDirector settings has a denser y-axis grid spacing and less-dense
            // x-axis grid spacing. In this demo, we want the tick spacing to be symmetrical.
            // We use around 50 pixels between major ticks and 25 pixels between minor ticks.
            c.xAxis().setTickDensity(50, 25);
            c.yAxis().setTickDensity(50, 25);

            //
            // In this example, we represent the data by scatter points. If you want to represent
            // the data by somethings else (lines, bars, areas, floating boxes, etc), just modify
            // the code below to use the layer type of your choice. 
            //

            // Add scatter layer, using 11 pixels red (ff33333) X shape symbols
            c.addScatterLayer(dataX0, dataY0, "Group A", Chart.Cross2Shape(), 11, 0xff3333);

            // Add scatter layer, using 11 pixels green (33ff33) circle symbols
            c.addScatterLayer(dataX1, dataY1, "Group B", Chart.CircleShape, 11, 0x33ff33);

            // Add scatter layer, using 11 pixels blue (3333ff) triangle symbols
            c.addScatterLayer(dataX2, dataY2, "Group C", Chart.TriangleSymbol, 11, 0x3333ff);

            if (maxX == minX)
            {
                // The axis scale has not yet been set up. So this is the first time the chart is
                // drawn and it is drawn with no zooming. We can use auto-scaling to determine the
                // axis-scales, then remember them for future use. 

                // Explicitly auto-scale axes so we can get the axis scales
                c.layout();

                // Save the axis scales for future use
                minX = c.xAxis().getMinValue();
                maxX = c.xAxis().getMaxValue();
                minY = c.yAxis().getMinValue();
                maxY = c.yAxis().getMaxValue();
            }
            else
            {
                // Compute the zoomed-in axis scales using the overall axis scales and ViewPort size
                double xScaleMin = minX + (maxX - minX) * viewer.ViewPortLeft;
                double xScaleMax = minX + (maxX - minX) * (viewer.ViewPortLeft +
                    viewer.ViewPortWidth);
                double yScaleMin = maxY - (maxY - minY) * (viewer.ViewPortTop +
                    viewer.ViewPortHeight);
                double yScaleMax = maxY - (maxY - minY) * viewer.ViewPortTop;
                // *** use the following formula if you are using a log scale axis ***
                // double xScaleMin = minX * Math.Pow(maxX / minX, viewer.ViewPortLeft);
                // double xScaleMax = minX * Math.Pow(maxX / minX, viewer.ViewPortLeft + 
                //	  viewer.ViewPortWidth);
                // double yScaleMin = maxY * Math.Pow(minY / maxY, viewer.ViewPortTop + 
                //	  viewer.ViewPortHeight);
                // double yScaleMax = maxY * Math.Pow(minY / maxY, viewer.ViewPortTop);

                // Set the axis scales
                c.xAxis().setLinearScale(xScaleMin, xScaleMax);
                c.xAxis().setRounding(false, false);
                c.yAxis().setLinearScale(yScaleMin, yScaleMax);
                c.yAxis().setRounding(false, false);
            }

            // Set the chart image to the WinChartViewer
            winChartViewer1.Chart = c;
        }

        /// <summary>
        /// Update the image map used on the chart.
        /// </summary>
        private void updateImageMap(WinChartViewer viewer)
        {
            // Include tool tip for the chart
            if (winChartViewer1.ImageMap == null)
            {
                winChartViewer1.ImageMap = winChartViewer1.Chart.getHTMLImageMap("clickable", "",
                    "title='[{dataSetName}] Alpha = {x}, Beta = {value}'");
            }
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FrmZoomScrollDemo2));
            this.winChartViewer1 = new ChartDirector.WinChartViewer();
            this.buttonRepeatTimer = new System.Windows.Forms.Timer(this.components);
            this.leftPanel = new System.Windows.Forms.Panel();
            this.zoomLevelLabel = new System.Windows.Forms.Label();
            this.downRightPB = new System.Windows.Forms.Button();
            this.downPB = new System.Windows.Forms.Button();
            this.rightPB = new System.Windows.Forms.Button();
            this.separator = new System.Windows.Forms.Label();
            this.pointerPB = new System.Windows.Forms.RadioButton();
            this.zoomInPB = new System.Windows.Forms.RadioButton();
            this.zoomOutPB = new System.Windows.Forms.RadioButton();
            this.centerPB = new System.Windows.Forms.Button();
            this.upRightPB = new System.Windows.Forms.Button();
            this.downLeftPB = new System.Windows.Forms.Button();
            this.zoomBar = new System.Windows.Forms.TrackBar();
            this.navigatePad = new System.Windows.Forms.Panel();
            this.navigateWindow = new System.Windows.Forms.Label();
            this.leftPB = new System.Windows.Forms.Button();
            this.upPB = new System.Windows.Forms.Button();
            this.upLeftPB = new System.Windows.Forms.Button();
            this.topLabel = new System.Windows.Forms.Label();
            this.toolTip = new System.Windows.Forms.ToolTip(this.components);
            this.leftPanel.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.zoomBar)).BeginInit();
            this.navigatePad.SuspendLayout();
            this.SuspendLayout();
            // 
            // winChartViewer1
            // 
            this.winChartViewer1.ChartSizeMode = ChartDirector.WinChartSizeMode.StretchImage;
            this.winChartViewer1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.winChartViewer1.HotSpotCursor = System.Windows.Forms.Cursors.Hand;
            this.winChartViewer1.Location = new System.Drawing.Point(96, 24);
            this.winChartViewer1.Name = "winChartViewer1";
            this.winChartViewer1.ScrollDirection = ChartDirector.WinChartDirection.HorizontalVertical;
            this.winChartViewer1.Size = new System.Drawing.Size(500, 482);
            this.winChartViewer1.TabIndex = 0;
            this.winChartViewer1.TabStop = false;
            this.winChartViewer1.ZoomDirection = ChartDirector.WinChartDirection.HorizontalVertical;
            this.winChartViewer1.ViewPortChanged += new ChartDirector.WinViewPortEventHandler(this.winChartViewer1_ViewPortChanged);
            this.winChartViewer1.MouseEnter += new System.EventHandler(this.winChartViewer1_MouseEnter);
            this.winChartViewer1.ClickHotSpot += new ChartDirector.WinHotSpotEventHandler(this.winChartViewer1_ClickHotSpot);
            // 
            // buttonRepeatTimer
            // 
            this.buttonRepeatTimer.Tick += new System.EventHandler(this.buttonRepeatTimer_Tick);
            // 
            // leftPanel
            // 
            this.leftPanel.BackColor = System.Drawing.Color.LightGray;
            this.leftPanel.Controls.AddRange(new System.Windows.Forms.Control[] {
																					this.zoomLevelLabel,
																					this.downRightPB,
																					this.downPB,
																					this.rightPB,
																					this.separator,
																					this.pointerPB,
																					this.zoomInPB,
																					this.zoomOutPB,
																					this.centerPB,
																					this.upRightPB,
																					this.downLeftPB,
																					this.zoomBar,
																					this.navigatePad,
																					this.leftPB,
																					this.upPB,
																					this.upLeftPB});
            this.leftPanel.Dock = System.Windows.Forms.DockStyle.Left;
            this.leftPanel.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.leftPanel.Location = new System.Drawing.Point(0, 24);
            this.leftPanel.Name = "leftPanel";
            this.leftPanel.Size = new System.Drawing.Size(96, 482);
            this.leftPanel.TabIndex = 15;
            // 
            // zoomLevelLabel
            // 
            this.zoomLevelLabel.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.zoomLevelLabel.Location = new System.Drawing.Point(12, 252);
            this.zoomLevelLabel.Name = "zoomLevelLabel";
            this.zoomLevelLabel.Size = new System.Drawing.Size(80, 16);
            this.zoomLevelLabel.TabIndex = 33;
            this.zoomLevelLabel.Text = "Zoom Level";
            // 
            // downRightPB
            // 
            this.downRightPB.Image = ((System.Drawing.Bitmap)(resources.GetObject("downRightPB.Image")));
            this.downRightPB.Location = new System.Drawing.Point(64, 184);
            this.downRightPB.Name = "downRightPB";
            this.downRightPB.Size = new System.Drawing.Size(33, 33);
            this.downRightPB.TabIndex = 12;
            this.toolTip.SetToolTip(this.downRightPB, "Click to move the view port in the desired direction.");
            this.downRightPB.MouseUp += new System.Windows.Forms.MouseEventHandler(this.navigateButton_MouseUp);
            this.downRightPB.MouseDown += new System.Windows.Forms.MouseEventHandler(this.navigateButton_MouseDown);
            // 
            // downPB
            // 
            this.downPB.Image = ((System.Drawing.Bitmap)(resources.GetObject("downPB.Image")));
            this.downPB.Location = new System.Drawing.Point(32, 184);
            this.downPB.Name = "downPB";
            this.downPB.Size = new System.Drawing.Size(33, 33);
            this.downPB.TabIndex = 11;
            this.toolTip.SetToolTip(this.downPB, "Click to move the view port in the desired direction.");
            this.downPB.MouseUp += new System.Windows.Forms.MouseEventHandler(this.navigateButton_MouseUp);
            this.downPB.MouseDown += new System.Windows.Forms.MouseEventHandler(this.navigateButton_MouseDown);
            // 
            // rightPB
            // 
            this.rightPB.Image = ((System.Drawing.Bitmap)(resources.GetObject("rightPB.Image")));
            this.rightPB.Location = new System.Drawing.Point(64, 152);
            this.rightPB.Name = "rightPB";
            this.rightPB.Size = new System.Drawing.Size(33, 33);
            this.rightPB.TabIndex = 9;
            this.toolTip.SetToolTip(this.rightPB, "Click to move the view port in the desired direction.");
            this.rightPB.MouseUp += new System.Windows.Forms.MouseEventHandler(this.navigateButton_MouseUp);
            this.rightPB.MouseDown += new System.Windows.Forms.MouseEventHandler(this.navigateButton_MouseDown);
            // 
            // separator
            // 
            this.separator.BackColor = System.Drawing.Color.Black;
            this.separator.Dock = System.Windows.Forms.DockStyle.Right;
            this.separator.Location = new System.Drawing.Point(95, 0);
            this.separator.Name = "separator";
            this.separator.Size = new System.Drawing.Size(1, 482);
            this.separator.TabIndex = 32;
            // 
            // pointerPB
            // 
            this.pointerPB.Appearance = System.Windows.Forms.Appearance.Button;
            this.pointerPB.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.pointerPB.Image = ((System.Drawing.Bitmap)(resources.GetObject("pointerPB.Image")));
            this.pointerPB.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.pointerPB.Name = "pointerPB";
            this.pointerPB.Size = new System.Drawing.Size(96, 29);
            this.pointerPB.TabIndex = 1;
            this.pointerPB.TabStop = true;
            this.pointerPB.Text = "      Pointer";
            this.toolTip.SetToolTip(this.pointerPB, "Click to display hot spot parameters.\nDrag to scroll.");
            this.pointerPB.CheckedChanged += new System.EventHandler(this.pointerPB_CheckedChanged);
            // 
            // zoomInPB
            // 
            this.zoomInPB.Appearance = System.Windows.Forms.Appearance.Button;
            this.zoomInPB.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.zoomInPB.Image = ((System.Drawing.Bitmap)(resources.GetObject("zoomInPB.Image")));
            this.zoomInPB.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.zoomInPB.Location = new System.Drawing.Point(0, 28);
            this.zoomInPB.Name = "zoomInPB";
            this.zoomInPB.Size = new System.Drawing.Size(96, 29);
            this.zoomInPB.TabIndex = 2;
            this.zoomInPB.TabStop = true;
            this.zoomInPB.Text = "      Zoom In";
            this.toolTip.SetToolTip(this.zoomInPB, "Click to zoom in.\nDrag to select zoom region.");
            this.zoomInPB.CheckedChanged += new System.EventHandler(this.zoomInPB_CheckedChanged);
            // 
            // zoomOutPB
            // 
            this.zoomOutPB.Appearance = System.Windows.Forms.Appearance.Button;
            this.zoomOutPB.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.zoomOutPB.Image = ((System.Drawing.Bitmap)(resources.GetObject("zoomOutPB.Image")));
            this.zoomOutPB.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.zoomOutPB.Location = new System.Drawing.Point(0, 56);
            this.zoomOutPB.Name = "zoomOutPB";
            this.zoomOutPB.Size = new System.Drawing.Size(96, 28);
            this.zoomOutPB.TabIndex = 3;
            this.zoomOutPB.TabStop = true;
            this.zoomOutPB.Text = "      Zoom Out";
            this.toolTip.SetToolTip(this.zoomOutPB, "Click to zoom out.");
            this.zoomOutPB.CheckedChanged += new System.EventHandler(this.zoomOutPB_CheckedChanged);
            // 
            // centerPB
            // 
            this.centerPB.Image = ((System.Drawing.Bitmap)(resources.GetObject("centerPB.Image")));
            this.centerPB.Location = new System.Drawing.Point(32, 152);
            this.centerPB.Name = "centerPB";
            this.centerPB.Size = new System.Drawing.Size(33, 33);
            this.centerPB.TabIndex = 8;
            this.toolTip.SetToolTip(this.centerPB, "Click to center the view port.");
            this.centerPB.MouseUp += new System.Windows.Forms.MouseEventHandler(this.navigateButton_MouseUp);
            this.centerPB.MouseDown += new System.Windows.Forms.MouseEventHandler(this.centerPB_MouseDown);
            // 
            // upRightPB
            // 
            this.upRightPB.Image = ((System.Drawing.Bitmap)(resources.GetObject("upRightPB.Image")));
            this.upRightPB.Location = new System.Drawing.Point(64, 120);
            this.upRightPB.Name = "upRightPB";
            this.upRightPB.Size = new System.Drawing.Size(33, 33);
            this.upRightPB.TabIndex = 6;
            this.toolTip.SetToolTip(this.upRightPB, "Click to move the view port in the desired direction.");
            this.upRightPB.MouseUp += new System.Windows.Forms.MouseEventHandler(this.navigateButton_MouseUp);
            this.upRightPB.MouseDown += new System.Windows.Forms.MouseEventHandler(this.navigateButton_MouseDown);
            // 
            // downLeftPB
            // 
            this.downLeftPB.Image = ((System.Drawing.Bitmap)(resources.GetObject("downLeftPB.Image")));
            this.downLeftPB.Location = new System.Drawing.Point(0, 184);
            this.downLeftPB.Name = "downLeftPB";
            this.downLeftPB.Size = new System.Drawing.Size(33, 33);
            this.downLeftPB.TabIndex = 10;
            this.toolTip.SetToolTip(this.downLeftPB, "Click to move the view port in the desired direction.");
            this.downLeftPB.MouseUp += new System.Windows.Forms.MouseEventHandler(this.navigateButton_MouseUp);
            this.downLeftPB.MouseDown += new System.Windows.Forms.MouseEventHandler(this.navigateButton_MouseDown);
            // 
            // zoomBar
            // 
            this.zoomBar.Location = new System.Drawing.Point(-4, 268);
            this.zoomBar.Maximum = 100;
            this.zoomBar.Minimum = 1;
            this.zoomBar.Name = "zoomBar";
            this.zoomBar.Size = new System.Drawing.Size(104, 45);
            this.zoomBar.TabIndex = 13;
            this.zoomBar.TabStop = false;
            this.zoomBar.TickFrequency = 10;
            this.zoomBar.TickStyle = System.Windows.Forms.TickStyle.Both;
            this.toolTip.SetToolTip(this.zoomBar, "Side to control the zoom ratio.");
            this.zoomBar.Value = 1;
            this.zoomBar.ValueChanged += new System.EventHandler(this.zoomBar_ValueChanged);
            // 
            // navigatePad
            // 
            this.navigatePad.AllowDrop = true;
            this.navigatePad.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(255)));
            this.navigatePad.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.navigatePad.Controls.AddRange(new System.Windows.Forms.Control[] {
																					  this.navigateWindow});
            this.navigatePad.Location = new System.Drawing.Point(0, 348);
            this.navigatePad.Name = "navigatePad";
            this.navigatePad.Size = new System.Drawing.Size(96, 88);
            this.navigatePad.TabIndex = 19;
            // 
            // navigateWindow
            // 
            this.navigateWindow.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224)));
            this.navigateWindow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.navigateWindow.Location = new System.Drawing.Point(16, 16);
            this.navigateWindow.Name = "navigateWindow";
            this.navigateWindow.Size = new System.Drawing.Size(56, 48);
            this.navigateWindow.TabIndex = 0;
            this.toolTip.SetToolTip(this.navigateWindow, "Drag to move the view port.");
            this.navigateWindow.MouseMove += new System.Windows.Forms.MouseEventHandler(this.navigateWindow_MouseMove);
            this.navigateWindow.MouseDown += new System.Windows.Forms.MouseEventHandler(this.navigateWindow_MouseDown);
            // 
            // leftPB
            // 
            this.leftPB.Image = ((System.Drawing.Bitmap)(resources.GetObject("leftPB.Image")));
            this.leftPB.Location = new System.Drawing.Point(0, 152);
            this.leftPB.Name = "leftPB";
            this.leftPB.Size = new System.Drawing.Size(33, 33);
            this.leftPB.TabIndex = 7;
            this.toolTip.SetToolTip(this.leftPB, "Click to move the view port in the desired direction.");
            this.leftPB.MouseUp += new System.Windows.Forms.MouseEventHandler(this.navigateButton_MouseUp);
            this.leftPB.MouseDown += new System.Windows.Forms.MouseEventHandler(this.navigateButton_MouseDown);
            // 
            // upPB
            // 
            this.upPB.Image = ((System.Drawing.Bitmap)(resources.GetObject("upPB.Image")));
            this.upPB.Location = new System.Drawing.Point(32, 120);
            this.upPB.Name = "upPB";
            this.upPB.Size = new System.Drawing.Size(33, 33);
            this.upPB.TabIndex = 5;
            this.toolTip.SetToolTip(this.upPB, "Click to move the view port in the desired direction.");
            this.upPB.MouseUp += new System.Windows.Forms.MouseEventHandler(this.navigateButton_MouseUp);
            this.upPB.MouseDown += new System.Windows.Forms.MouseEventHandler(this.navigateButton_MouseDown);
            // 
            // upLeftPB
            // 
            this.upLeftPB.Image = ((System.Drawing.Bitmap)(resources.GetObject("upLeftPB.Image")));
            this.upLeftPB.Location = new System.Drawing.Point(0, 120);
            this.upLeftPB.Name = "upLeftPB";
            this.upLeftPB.Size = new System.Drawing.Size(33, 33);
            this.upLeftPB.TabIndex = 4;
            this.toolTip.SetToolTip(this.upLeftPB, "Click to move the view port in the desired direction.");
            this.upLeftPB.MouseUp += new System.Windows.Forms.MouseEventHandler(this.navigateButton_MouseUp);
            this.upLeftPB.MouseDown += new System.Windows.Forms.MouseEventHandler(this.navigateButton_MouseDown);
            // 
            // topLabel
            // 
            this.topLabel.BackColor = System.Drawing.Color.Navy;
            this.topLabel.Dock = System.Windows.Forms.DockStyle.Top;
            this.topLabel.Font = new System.Drawing.Font("Arial", 9.75F, (System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic), System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.topLabel.ForeColor = System.Drawing.Color.Yellow;
            this.topLabel.Name = "topLabel";
            this.topLabel.Size = new System.Drawing.Size(596, 24);
            this.topLabel.TabIndex = 18;
            this.topLabel.Text = "Advanced Software Engineering";
            this.topLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // FrmZoomScrollDemo2
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(255)));
            this.ClientSize = new System.Drawing.Size(596, 506);
            this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.winChartViewer1,
																		  this.leftPanel,
																		  this.topLabel});
            this.MinimumSize = new System.Drawing.Size(604, 540);
            this.Name = "FrmZoomScrollDemo2";
            this.Text = "ChartDirector Zooming and Scrolling Demonstration (2)";
            this.Load += new System.EventHandler(this.FrmZoomScrollDemo2_Load);
            this.leftPanel.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.zoomBar)).EndInit();
            this.navigatePad.ResumeLayout(false);
            this.ResumeLayout(false);

        }
        #endregion

    }
}
